package cn.ultrarisk.scadmin.manager.scheduler;

import cn.ultrarisk.scadmin.manager.biz.common.context.OperationType;
import cn.ultrarisk.scadmin.manager.biz.common.service.OperationLogService;
import cn.ultrarisk.scadmin.manager.biz.zookeeper.service.ZkNodeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 * ZKGatherScheduler
 *
 * @author sevendlong(lin23871@163.com)
 * @date 2014/5/17
 * @since V1.0
 */
@Component
public class ZKGatherScheduler {
    @Autowired
    private ZkNodeService zkNodeService;
    @Autowired
    private OperationLogService operationLogService;

    /**
     * 采集zk数据
     */
    public void execute() {
        zkNodeService.saveByZKPath("/", 0);
        operationLogService.createGatherLog(OperationType.GATHER_ZK);
    }
}
